<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8">
		<title>地图展示</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge">
		<style>
			body,
			html,
			#container {
				overflow: hidden;
				width: 100%;
				height: 100%;
				margin: 0;
				font-family: "微软雅黑";
			}

			.info {
				z-index: 999;
				width: auto;
				min-width: 22rem;
				padding: .75rem 1.25rem;
				margin-left: 1.25rem;
				position: fixed;
				top: 1rem;
				background-color: #fff;
				border-radius: .25rem;
				font-size: 14px;
				color: #666;
				box-shadow: 0 2px 6px 0 rgba(27, 142, 236, 0.5);
			}
		</style>
		<script src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak=h44h8rEG5Ovol1CHQUbDAm04BalDmx1R"></script>
	</head>
	<body>
		<!-- <div class="info">最新版GL地图命名空间为BMapGL, 可按住鼠标右键控制地图旋转、修改倾斜角度。</div> -->
		<div id="container"></div>
	</body>
</html>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script>
	$.ajax({
		url: "http://47.114.111.108:9020/app/homepage/enterpriseAnalysisMore",
		dataType:'application/x-www-form-urlencoded',
		success: (res) => {
			// console.log('success', res)
		},
		complete: (res) => {
			var data = JSON.parse(res.responseText).data
			console.log('complete', data)
			console.log('complete',JSON.parse(res.responseText).data)
		}
	})
	var map = new BMapGL.Map('container'); // 创建Map实例
	map.centerAndZoom(new BMapGL.Point(118.336751, 29.827279), 12); // 初始化地图,设置中心点坐标和地图级别
	map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放
	var bd = new BMapGL.Boundary();
	bd.get('徽州区', function (rs) {
	    var hole = new BMapGL.Polygon(rs.boundaries, {
	        fillColor: '#80d8ff',
	        fillOpacity: 0.2,
			strokeWeight: 1, 
			strokeColor: "#0091ea"
	    });
	    map.addOverlay(hole);
	});
	
	
	let list0 = [];
	let list1 = [];
	let list2 = [];
	let list3 = [];
	console.log('data.list', data.list)
	// for (var i = 0; i < data.list.length; i++) {
	//   if (data.list[i].Maps.hjgc01.state == 0) {
	//     console.log(data.list[i].Maps.hjgc01);
	//     list0.push([data.list[i].latitude, data.list[i].longitude, Math.ceil(data.list[i].Maps.hjgc01.value), data.list[i].name])
	//   } else if (data.list[i].Maps.hjgc01.state == 1) {
	//     list1.push([data.list[i].latitude, data.list[i].longitude, Math.ceil(data.list[i].Maps.hjgc01.value), data.list[i].name])
	//   } else if (data.list[i].Maps.hjgc01.state == 2) {
	//     list2.push([data.list[i].latitude, data.list[i].longitude, Math.ceil(data.list[i].Maps.hjgc01.value), data.list[i].name])
	//   } else if (data.list[i].Maps.hjgc01.state == 3) {
	//     list3.push([data.list[i].latitude, data.list[i].longitude, Math.ceil(data.list[i].Maps.hjgc01.value), data.list[i].name])
	//   }
	// }
	
	
	// // 创建小车图标
	// var myIcon = new BMapGL.Icon("./picture/hui.png", new BMapGL.Size(40, 50));
	
	// for (var i = 0; i < list0.length; i++) {
	  
	//   let pt = new BMapGL.Point(Number(list0[i][1], Number(list0[i][0]);
	//   let marker = new BMapGL.Marker(pt, {
	//       icon: myIcon
	//   });
	//   // 将标注添加到地图
	//   map.addOverlay(marker);
	// }
	
</script>
